home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / PMENU.C < prev    next >
C/C++ Source or Header  |  1990-11-24  |  4KB  |  174 lines

  1. /* HeadEdit's '/' pulldown menu */
  2.  
  3. #include "msgg.h"
  4. #include "twindow.h"
  5. #include "keys.h"
  6. #include "headedit.h"
  7.  
  8. extern void pascal edit_node(void);
  9.  
  10.  
  11. char *mainselcs[]={
  12.     " Quit/Cont (ESC) ",
  13.     " Toggle Wrap (^W) ",
  14.     " Toggle Origin (^O) ",
  15.     " Edit Default Origin (aO) ",
  16.     " Toggle Kludge Lines (^T) ",
  17.     " Save LMRs (^S) ",
  18.     " Load LMRs (^A) ",
  19.     " Kill Junk (^K) ",
  20.     " Toggle Current Name (aT) ",
  21.     " Toggle Delete View (aD) ",
  22.     " Change Address (aC) ",
  23.     " NodeList Review (aN) ",
  24.     " DOS Shell (aJ) ",
  25.     " Exit NOW (aX) ",
  26.     " Breakdown Echo ",
  27.     " Edit nodelist entry ",
  28.     " Send complaint to author ",
  29.     NULL
  30. };
  31.  
  32. char *areaselcs[]={
  33.     " Point & Shoot (aA) ",
  34.     " Enter New # (F8) ",
  35.     " Next (>)",
  36.     " Previous (<) ",
  37.     NULL
  38. };
  39.  
  40. char *postselcs[]={
  41.     " Reply (R) ",
  42.     " Edit Text (F3) ",
  43.     " Edit Hdr (F7) ",
  44.     " New Msg (W) ",
  45.     " Net Reply To Echo Msg (^R) ",
  46.     NULL
  47. };
  48.  
  49. char *msgselcs[]={
  50.     " Point & Shoot (aL) ",
  51.     " Enter New # (F9) ",
  52.     " Next (^PGDN) ",
  53.     " Previous (^PGUP) ",
  54.     " Thread Forward (^F) ",
  55.     " Thread Back (^B) ",
  56.     " Selective (F6) ",
  57.     " Next Match (^L) ",
  58.     " Delete (^D) ",
  59.     " Node Info. (^N) ",
  60.     " Edit Hdr (F7) ",
  61.     " Export Msg (^E) ",
  62.     " Print Msgs (+) ",
  63.     " Move/Forward (F10) ",
  64.     " Scan Msgs (F2) ",
  65.     " First Msg (^HOME) ",
  66.     " Last Msg (^END) ",
  67.     " View Assoc File (V) ",
  68.     " Reverse Search (^F6) ",
  69.     NULL
  70. };
  71.  
  72. char *spawnselcs[]={
  73.     "1               ",
  74.     "2               ",
  75.     "3               ",
  76.     "4               ",
  77.     "5               ",
  78.     "6               ",
  79.     "7               ",
  80.     "8               ",
  81.     "9               ",
  82.     "0               ",
  83.     NULL
  84. };
  85.  
  86. char *saveposselcs[]={
  87.     "Pos 0",
  88.     "Pos 1",
  89.     "Pos 2",
  90.     "Pos 3",
  91.     "Pos 4",
  92.     "Pos 5",
  93.     "Pos 6",
  94.     "Pos 7",
  95.     "Pos 8",
  96.     "Pos 9",
  97.     NULL
  98. };
  99.  
  100. char *restoreposselcs[]={
  101.     "Pos 0",
  102.     "Pos 1",
  103.     "Pos 2",
  104.     "Pos 3",
  105.     "Pos 4",
  106.     "Pos 5",
  107.     "Pos 6",
  108.     "Pos 7",
  109.     "Pos 8",
  110.     "Pos 9",
  111.     NULL
  112. };
  113.  
  114.  
  115. static int mainkeys[]={ ESC,CTRL_W,CTRL_O,ALT_O,CTRL_T,CTRL_S,1,CTRL_K,
  116.                         ALT_T,ALT_D,ALT_C,ALT_N,ALT_J,ALT_X,258,257,256};
  117. static int areakeys[]={ ALT_A,F8, (int)'>', (int)'<' };
  118. static int postkeys[]={ (int)'R',F3,F7,(int)'W',CTRL_R};
  119. static int msgkeys[]= {ALT_L,F9,CTRL_PGDN,CTRL_PGUP,CTRL_F,CTRL_B,
  120.                        F6,CTRL_L,CTRL_D,CTRL_N,F7,CTRL_E,(int)'+',F10,
  121.                        F2,CTRL_HOME,CTRL_END,'V',CTRL_F6};
  122. static int spawnkeys[]={ALT_F1,ALT_F2,ALT_F3,ALT_F4,ALT_F5,ALT_F6,ALT_F7,
  123.                         ALT_F8,ALT_F9,ALT_F10};
  124. static int saveposkeys[]={ALT_0,ALT_1,ALT_2,ALT_3,ALT_4,ALT_5,ALT_6,ALT_7,
  125.                           ALT_8,ALT_9};
  126. static int restoreposkeys[]={(int)'0',(int)'1',(int)'2',(int)'3',(int)'4',
  127.                              (int)'5',(int)'6',(int)'7',(int)'8',(int)'9'};
  128.  
  129. static KMENU tmn[]={
  130.     {" Msgs ",msgselcs,msgkeys},
  131.     {" Areas ",areaselcs,areakeys},
  132.     {" Post ",postselcs,postkeys},
  133.     {" Spawn ",spawnselcs,spawnkeys},
  134.     {" Save Pos ",saveposselcs,saveposkeys},
  135.     {" Rstr Pos ",restoreposselcs,restoreposkeys},
  136.     {" Misc ",mainselcs,mainkeys},
  137.     {NULL,NULL,NULL}
  138. };
  139.  
  140.  
  141. int pascal exec (void) {
  142.  
  143.     register int x;
  144.  
  145.     for(x=0;x<10;x++) {
  146.         if(!fkey[x]) strcpy(spawnselcs[x]," Unused ");
  147.         else {
  148.             strcpy(spawnselcs[x]," ");
  149.             if(!strnicmp(fkey[x],"COMMAND.COM /C",14)) {
  150.                 strncat(spawnselcs[x],&fkey[x][15],13);
  151.             }
  152.             else strncat(spawnselcs[x],fkey[x],13);
  153.             spawnselcs[x][14]=0;
  154.             strcat(spawnselcs[x]," ");
  155.             spawnselcs[x][15]=0;
  156.         }
  157.     }
  158.     x=kmenu_select(" You rang? ",tmn);
  159.     if(x==256) {
  160.         printf("\x1b[2J\n\x1b[0;2;37m $0.00 <=-Here's your refund.  Don't use it anymore.\n");
  161.         exit(255);
  162.     }
  163.     else if(x==257) {
  164.         edit_node();
  165.         return 0;
  166.     }
  167.     else if(x==258) {
  168.         do_breakdown();
  169.         return 0;
  170.     }
  171.     return x;
  172. }
  173.  
  174.